From 6b422c28fad9b0c0a9caf5c98eb8db1d7914e976 Mon Sep 17 00:00:00 2001 From: "iap10@labyrinth.cl.cam.ac.uk" Date: Sat, 22 Jan 2005 21:34:34 +0000 Subject: [PATCH] bitkeeper revision 1.1159.223.18 (41f2c6eamwtTkjdrv4CuL1WnOy4iGw) Description: use INSTALL everywhere Use install(by way of INSTALL variables) to create directories, install programs, and install data files. From: Adam Heath Signed-off-by: ian.pratt@cl.cam.ac.uk --- Makefile | 22 +++++++++++++--------- tools/examples/Makefile | 20 ++++++++++++-------- tools/libxc/Makefile | 12 ++++++++---- tools/libxutil/Makefile | 9 +++++++-- tools/misc/Makefile | 11 +++++++---- tools/misc/miniterm/Makefile | 7 +++++-- tools/sv/Makefile | 18 ++++++++++-------- tools/xentrace/Makefile | 16 ++++++++++------ tools/xfrd/Makefile | 8 ++++++-- xen/Makefile | 17 ++++++++++------- 10 files changed, 88 insertions(+), 52 deletions(-) diff --git a/Makefile b/Makefile index 7332978f99..ecbc022e10 100644 --- a/Makefile +++ b/Makefile @@ -4,6 +4,10 @@ DIST_DIR ?= $(shell pwd)/dist INSTALL_DIR ?= $(DIST_DIR)/install +INSTALL := install +INSTALL_DIR := $(INSTALL) -d -m0755 +INSTALL_DATA := $(INSTALL) -m0644 +INSTALL_PROG := $(INSTALL) -m0755 KERNELS ?= linux-2.6-xen0 linux-2.6-xenU # linux-2.4-xen0 linux-2.4-xenU netbsd-2.0-xenU @@ -35,21 +39,21 @@ install-tools: $(MAKE) -C tools install install-kernels: - $(shell cp -a $(INSTALL_DIR)/boot/* /boot/) - $(shell cp -a $(INSTALL_DIR)/lib/modules/* /lib/modules/) - $(shell cp -dR $(INSTALL_DIR)/boot/*$(LINUX_VER)* $(prefix)/boot/) - $(shell cp -dR $(INSTALL_DIR)/lib/modules/* $(prefix)/lib/modules/) + cp -a $(INSTALL_DIR)/boot/* /boot/ + cp -a $(INSTALL_DIR)/lib/modules/* /lib/modules/ + cp -dR $(INSTALL_DIR)/boot/*$(LINUX_VER)* $(prefix)/boot/ + cp -dR $(INSTALL_DIR)/lib/modules/* $(prefix)/lib/modules/ install-docs: sh ./docs/check_pkgs && $(MAKE) -C docs install || true # build and install everything into local dist directory dist: xen tools kernels docs - install -m0644 ./COPYING $(DIST_DIR) - install -m0644 ./README $(DIST_DIR) - install -m0755 ./install.sh $(DIST_DIR) - mkdir -p $(DIST_DIR)/check - install -m0755 tools/check/chk tools/check/check_* $(DIST_DIR)/check + $(INSTALL_DIR) $(DIST_DIR)/check + $(INSTALL_DATA) ./COPYING $(DIST_DIR) + $(INSTALL_DATA) ./README $(DIST_DIR) + $(INSTALL_PROG) ./install.sh $(DIST_DIR) + $(INSTALL_PROG) tools/check/chk tools/check/check_* $(DIST_DIR)/check xen: $(MAKE) prefix=$(INSTALL_DIR) dist=yes -C xen install diff --git a/tools/examples/Makefile b/tools/examples/Makefile index 14f18ae84f..b19b9710ba 100644 --- a/tools/examples/Makefile +++ b/tools/examples/Makefile @@ -1,3 +1,7 @@ +INSTALL = install +INSTALL_DIR = $(INSTALL) -d -m0755 +INSTALL_PROG = $(INSTALL) -m0755 +INSTALL_DATA = $(INSTALL) -m0644 # Init scripts. XEND_INITD = init.d/xend @@ -21,23 +25,23 @@ all: install: all install-initd install-configs install-scripts install-initd: - install -d $(prefix)/etc/init.d - install -m0755 $(XEND_INITD) $(prefix)/etc/init.d - install -m0755 $(XENDOMAINS_INITD) $(prefix)/etc/init.d + $(INSTALL_DIR) $(prefix)/etc/init.d + $(INSTALL_PROG) $(XEND_INITD) $(prefix)/etc/init.d + $(INSTALL_PROG) $(XENDOMAINS_INITD) $(prefix)/etc/init.d install-configs: - install -d $(prefix)$(XEN_CONFIG_DIR) - install -d $(prefix)$(XEN_CONFIG_DIR)/auto + $(INSTALL_DIR) $(prefix)$(XEN_CONFIG_DIR) + $(INSTALL_DIR) $(prefix)$(XEN_CONFIG_DIR)/auto for i in $(XEN_CONFIGS); \ do [ -a $(prefix)/$(XEN_CONFIG_DIR)/$$i ] || \ - install -m0644 $$i $(prefix)$(XEN_CONFIG_DIR); \ + $(INSTALL_DATA) $$i $(prefix)$(XEN_CONFIG_DIR); \ done install-scripts: - install -d $(prefix)$(XEN_SCRIPT_DIR) + $(INSTALL_DIR) $(prefix)$(XEN_SCRIPT_DIR) for i in $(XEN_SCRIPTS); \ do [ -a $(prefix)/$()/$$i ] || \ - install -m0755 $$i $(prefix)$(XEN_SCRIPT_DIR); \ + $(INSTALL_PROG) $$i $(prefix)$(XEN_SCRIPT_DIR); \ done clean: diff --git a/tools/libxc/Makefile b/tools/libxc/Makefile index c8960c2a51..c77b5c2767 100644 --- a/tools/libxc/Makefile +++ b/tools/libxc/Makefile @@ -1,3 +1,7 @@ +INSTALL = install +INSTALL_PROG = $(INSTALL) -m0755 +INSTALL_DATA = $(INSTALL) -m0644 +INSTALL_DIR = $(INSTALL) -d -m0755 MAJOR := 2.0 MINOR := 0 @@ -64,12 +68,12 @@ mk-symlinks: ln -sf ../../$(LINUX_ROOT)/include/asm-xen/linux-public/*.h . ) install: all - mkdir -p $(prefix)/usr/lib - mkdir -p $(prefix)/usr/include - install -m0755 $(LIB) $(prefix)/usr/lib + $(INSTALL_DIR) $(prefix)/usr/lib + $(INSTALL_DIR) $(prefix)/usr/include + $(INSTALL_PROG) $(LIB) $(prefix)/usr/lib ln -sf $(LIB_NAME).so.$(MAJOR).$(MINOR) $(prefix)/usr/lib/$(LIB_NAME).so.$(MAJOR) ln -sf $(LIB_NAME).so.$(MAJOR) $(prefix)/usr/lib/$(LIB_NAME).so - install -m0644 xc.h $(prefix)/usr/include + $(INSTALL_DATA) xc.h $(prefix)/usr/include clean: rm -rf *.a *.so *.o *.opic *.rpm $(LIB) *~ $(DEPS) xen diff --git a/tools/libxutil/Makefile b/tools/libxutil/Makefile index ae1b26ef6b..f576251224 100644 --- a/tools/libxutil/Makefile +++ b/tools/libxutil/Makefile @@ -1,4 +1,9 @@ XEN_ROOT = ../.. +INSTALL = install +INSTALL_DATA = $(INSTALL) -m0644 +INSTALL_PROG = $(INSTALL) -m0755 +INSTALL_DIR = $(INSTALL) -d -m0755 + include $(XEN_ROOT)/tools/Make.defs CC = gcc @@ -67,8 +72,8 @@ check-for-zlib: fi install: all - mkdir -p $(prefix)/usr/lib - install -m0755 $(LIB) $(prefix)/usr/lib + $(INSTALL_DIR) -p $(prefix)/usr/lib + $(INSTALL_PROG) $(LIB) $(prefix)/usr/lib ln -sf $(LIB_NAME).so.$(MAJOR).$(MINOR) $(prefix)/usr/lib/$(LIB_NAME).so.$(MAJOR) ln -sf $(LIB_NAME).so.$(MAJOR) $(prefix)/usr/lib/$(LIB_NAME).so diff --git a/tools/misc/Makefile b/tools/misc/Makefile index 7c20e8d1b0..ab67ba8198 100644 --- a/tools/misc/Makefile +++ b/tools/misc/Makefile @@ -1,3 +1,6 @@ +INSTALL = install +INSTALL_PROG = $(INSTALL) -m0755 +INSTALL_DIR = $(INSTALL) -d -m0755 XEN_ROOT=../.. include $(XEN_ROOT)/tools/Make.defs @@ -20,10 +23,10 @@ all: $(TARGETS) $(MAKE) -C miniterm install: all - mkdir -p $(prefix)/usr/bin - mkdir -p $(prefix)/usr/sbin - install -m0755 $(INSTALL_BIN) $(prefix)/usr/bin - install -m0755 $(INSTALL_SBIN) $(prefix)/usr/sbin + $(INSTALL_DIR) $(prefix)/usr/bin + $(INSTALL_DIR) $(prefix)/usr/sbin + $(INSTALL_PROG) $(INSTALL_BIN) $(prefix)/usr/bin + $(INSTALL_PROG) $(INSTALL_SBIN) $(prefix)/usr/sbin $(MAKE) -C miniterm install clean: diff --git a/tools/misc/miniterm/Makefile b/tools/misc/miniterm/Makefile index 86e1bf0ccf..fbe4a5bcee 100644 --- a/tools/misc/miniterm/Makefile +++ b/tools/misc/miniterm/Makefile @@ -1,3 +1,6 @@ +INSTALL = install +INSTALL_PROG = $(INSTALL) -m0755 +INSTALL_DIR = $(INSTALL) -d -m0755 CC = gcc CFLAGS = -Wall -O3 @@ -6,8 +9,8 @@ TARGET = miniterm all: $(TARGET) install: all - mkdir -p $(prefix)/usr/bin - install -m0755 $(TARGET) $(prefix)/usr/bin + $(INSTALL_DIR) $(prefix)/usr/bin + $(INSTALL_PROG) $(TARGET) $(prefix)/usr/bin clean: $(RM) *.o $(TARGET) *~ diff --git a/tools/sv/Makefile b/tools/sv/Makefile index 8ae9a93f87..a285dc15d5 100755 --- a/tools/sv/Makefile +++ b/tools/sv/Makefile @@ -1,4 +1,7 @@ -sv_insdir := $(prefix)/var/xen/sv +sv_insdir := $(prefix)/var/xen/sv +INSTALL = install +INSTALL_DIR = $(INSTALL) -d -m0755 +INSTALL_DATA = $(INSTALL) -m0644 all: @@ -14,17 +17,16 @@ IMAGES += next.png previous.png finish.png install: # copy XenSV Main.rpy file - @mkdir -p $(sv_insdir) - @install -m0644 Main.rpy $(sv_insdir) + @$(INSTALL_DIR) $(sv_insdir) + @$(INSTALL_DATA) Main.rpy $(sv_insdir) # copy XenSV images - @mkdir -p $(sv_insdir)/images - @(cd images && install -m0644 $(IMAGES) $(sv_insdir)/images) + @($(INSTALL_DIR) $(sv_insdir)/images + @(cd images && $(INSTALL_DATA) $(IMAGES) $(sv_insdir)/images) # copy XenSV stylesheet - @mkdir -p $(sv_insdir)/inc - @install -m0644 inc/style.css $(sv_insdir)/inc - @install -m0644 inc/script.js $(sv_insdir)/inc + @$(INSTALL_DIR) $(sv_insdir)/inc + @$(INSTALL_DATA) inc/style.css inc/script.js $(sv_insdir)/inc clean: diff --git a/tools/xentrace/Makefile b/tools/xentrace/Makefile index 1b13bd9d8b..c2545762a3 100644 --- a/tools/xentrace/Makefile +++ b/tools/xentrace/Makefile @@ -1,3 +1,7 @@ +INSTALL = install +INSTALL_PROG = $(INSTALL) -m0755 +INSTALL_DIR = $(INSTALL) -d -m0755 +INSTALL_DATA = $(INSTALL) -m0644 XEN_ROOT=../.. include $(XEN_ROOT)/tools/Make.defs @@ -20,12 +24,12 @@ MAN8 = $(wildcard *.8) all: $(BIN) install: all - mkdir -p $(prefix)/usr/bin - mkdir -p $(prefix)/usr/man/man1 - mkdir -p $(prefix)/usr/man/man8 - install -m0755 $(BIN) $(SCRIPTS) $(prefix)/usr/bin - install -m0644 $(MAN1) $(prefix)/usr/man/man1 - install -m0644 $(MAN8) $(prefix)/usr/man/man8 + $(INSTALL_DIR) $(prefix)/usr/bin + $(INSTALL_DIR) $(prefix)/usr/man/man1 + $(INSTALL_DIR) $(prefix)/usr/man/man8 + $(INSTALL_PROG) $(BIN) $(SCRIPTS) $(prefix)/usr/bin + $(INSTALL_DATA) $(MAN1) $(prefix)/usr/man/man1 + $(INSTALL_DATA) $(MAN8) $(prefix)/usr/man/man8 clean: $(RM) *.a *.so *.o *.rpm $(BIN) diff --git a/tools/xfrd/Makefile b/tools/xfrd/Makefile index 2330d829c4..07c17a3f35 100644 --- a/tools/xfrd/Makefile +++ b/tools/xfrd/Makefile @@ -4,6 +4,10 @@ # Mike Wray #============================================================================ +INSTALL = install +INSTALL_PROG = $(INSTALL) -m0755 +INSTALL_DIR = $(INSTALL) -d -m0755 + XEN_ROOT = ../.. include $(XEN_ROOT)/tools/Make.defs @@ -68,8 +72,8 @@ xfrd: $(XFRD_PROG_OBJ) .PHONY: install install: xfrd - mkdir -p $(prefix)/$(XFRD_INSTALL_DIR) - install -m 0755 xfrd $(prefix)/$(XFRD_INSTALL_DIR) + $(INSTALL_DIR) $(prefix)/$(XFRD_INSTALL_DIR) + $(INSTALL_PROG) xfrd $(prefix)/$(XFRD_INSTALL_DIR) .PHONY: libutil libutil: $(UTIL_LIB) diff --git a/xen/Makefile b/xen/Makefile index 7eb1d17847..28d8368464 100644 --- a/xen/Makefile +++ b/xen/Makefile @@ -1,3 +1,6 @@ +INSTALL = install +INSTALL_DATA = $(INSTALL) -m0644 +INSTALL_DIR = $(INSTALL) -d -m0755 # This is the correct place to edit the build version. # All other places this is stored (eg. compile.h) should be autogenerated. @@ -18,13 +21,13 @@ debug: objdump -D -S $(TARGET)-syms > $(TARGET).s install: $(TARGET).gz - mkdir -p $(prefix)/boot - install -m0644 $(TARGET).gz $(prefix)/boot - install -m0644 $(TARGET)-syms $(prefix)/boot - mkdir -p $(prefix)/usr/include/xen/io - install -m0644 include/public/*.h $(prefix)/usr/include/xen - install -m0644 include/public/io/*.h $(prefix)/usr/include/xen/io - install -m0644 include/public/COPYING $(prefix)/usr/include/xen + $(INSTALL_DIR) $(prefix)/boot + $(INSTALL_DATA) $(TARGET).gz $(prefix)/boot + $(INSTALL_DATA) $(TARGET)-syms $(prefix)/boot + $(INSTALL_DIR) $(prefix)/usr/include/xen/io + $(INSTALL_DATA) include/public/*.h $(prefix)/usr/include/xen + $(INSTALL_DATA) include/public/io/*.h $(prefix)/usr/include/xen/io + $(INSTALL_DATA) include/public/COPYING $(prefix)/usr/include/xen dist: $(TARGET) $(MAKE) prefix=`pwd`/../dist/install dist=yes install -- 2.30.2